const autocannon = require('autocannon');
const instance = autocannon({
    url: 'https://test.quchafen.com/api/sign',
    "headers": {
        "accept": "application/json, text/plain, */*",
        "accept-language": "zh-CN,zh;q=0.9",
        "Referrer-Policy": "strict-origin-when-cross-origin"
    },
    "body": JSON.stringify({
      "userName": "xl",
      "userUnit": "中福彩科技",
      "userDept": "应用研发部",
      "meetId": "1716945431486",
      "userPhone": "15313019655"
    }),
    "method": "POST", // 你接口的methods get / post
    connections: 10, // 连接数
    pipelining: 1, // 每个链接一个请求
    duration: 10 // 持续时间
}, (err, res) => {
  console.log('finished bench', err, res)
})

process.once('SIGINT', () => {
  instance.stop()
});

autocannon.track(instance, {renderProgressBar: true});